package br.unicamp.mc715.transport;

import java.io.Serializable;

/**
 * This interface represents a message. It holds the payload and the 
 * transport ids of sender and receiver sockets. <p>
 *
 */
public interface Message {
    
    /**
     * Returns the payload of this message. <p>
     * 
     * @return the payload of this message.
     */
    Serializable getPayload();
    
    /**
     * Returns the id of the socket that sent this message. <p>
     * 
     * @return the id of the socket that sent this message.
     */
    TransportId getSender();
    
    /**
     * Returns the id of the socket that received this message. <p>
     * 
     * @return the id of the socket that received this message. <p>
     */
    TransportId getReceiver();
    
}
